<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> 以PX为单位设置字体大小</title>
</head>

<body>
    <style>
        h1 {
            font-size: 40px;
        }

        h2 {
            font-size: 30px;
        }

        p {
            font-size: 14px;
        }
    </style>
    <h1>这是标题 1</h1>
    <h2>这是标题 2</h2>
    <p>这是一个段落。</p>
    <p>这是另一个段落。</p>
</body>

</html>